﻿/**
 *设备权限管理界面
 */

namespace Equipment {
    export class EquipmentAuthority implements UiFramework.IState {
        stateMgr: UiFramework.StateMgr;
        divSelf: HTMLDivElement;
        onInit(smgr: UiFramework.StateMgr) {
            this.stateMgr = smgr;
            this.divSelf = document.createElement("div");
            this.stateMgr.div.appendChild(this.divSelf);

            //头部div
            var headDiv = document.createElement("div");
            headDiv.style.position = "absolute";
            headDiv.style.width = "100%";
            headDiv.style.height = "7%";
            headDiv.style.lineHeight = "45px";
            headDiv.style.overflow = "hidden";
            this.divSelf.appendChild(headDiv);

            //头部title
            var tit = document.createElement("tit");
            tit.textContent = "摄像头应用";
            tit.style.height = "100%";
            tit.className = "configurationDetailTit";
            headDiv.appendChild(tit);

            //头部返回按钮
            var btnReturn = document.createElement("img");
            btnReturn.src = "picture/return.png";
            btnReturn.className = "configurationDetailReturn";
            headDiv.appendChild(btnReturn);

            //摄像头场景展示div
            var middleDiv = document.createElement("div");
            middleDiv.style.position = "absolute";
            middleDiv.style.top = '7%';
            middleDiv.style.width = "100%";
            middleDiv.style.height = "40%";
            middleDiv.style.background = "#FAF0F0";
            this.divSelf.appendChild(middleDiv);


        }

        // 界面传值
        onMessage(meassge: any) {

        }

        // 界面隐藏
        onHide() {
            this.stateMgr.div.removeChild(this.divSelf);
        }

        // 界面恢复
        onRecover() {
            this.stateMgr.div.appendChild(this.divSelf);
        }

        // 主机物理按键事件
        onEvent(event: UiFramework.SmartEvent) {
        }

        onExit() {
            this.stateMgr.div.removeChild(this.divSelf);
        }
    }
}

UiMap["equipmentAuthority"] = () => {
    return new Equipment.EquipmentAuthority();
}